package com.mvc.controller;


import com.mvc.annotion.Controller;
import com.mvc.annotion.RequestMapping;
import com.mvc.annotion.Resource;
import com.mvc.service.GoodsService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("/info")
public class TestController {
    @Resource
    private GoodsService goodsService;

    @RequestMapping("/select")
    public String findGoods(HttpServletRequest request, HttpServletResponse response,String name){
       return goodsService.findGoodsList();
    }


    @RequestMapping("/insert")
    public String insert(HttpServletRequest request, HttpServletResponse response,String name){
        try {
            return goodsService.insert("马云");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "ok";
    }
}
